package moxl.parser.assemblers.doctypedecl;

import moxl.parser.ParserException;
import moxl.tokenizer.TokenizerException;
import moxl.tokenizer.xml.doctype.DocumentTypeBodyStartState;

public class DocumentTypeDeclarationExpectingDoctypeState extends DocumentTypeDeclarationStateDelegateBase
{
	@Override
	protected void acceptName(DocumentTypeDeclarationAssemblerContext ctx) throws ParserException, TokenizerException
	{
		if (ctx.getToken().getImage().equals("DOCTYPE"))
		{
			ctx.setTokenStreamMode(DocumentTypeBodyStartState.getInstance());
			ctx.changeState(DocumentTypeDeclarationAssemblerState.DocumentTypeDeclarationExpectingBodyState);
		}
		else
		{
			throw new ParserException("Expecting DOCTYPE here", ctx.getLocation());
		}
	}
}
